<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
    String basePath = request.getScheme()+"://"+
            request.getServerName()+":"
            +request.getServerPort()+
            request.getContextPath()+"/";
%>
<html>
<head>
    <title>图书界面</title>
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <base href="<%=basePath%>">
</head>
<body>
<div class="container">
    <div class="row clearfix">
            <div class="col-md-12 column">
                <div class="page-header">
                    <h1>
                        <small>书籍列表——————显示所有书籍</small>
                    </h1>
                </div>
            </div>
            <div class="row col-md-4 column">
                <a class="btn btn-primary" href="book/toAddBook.do">新增书籍</a>
                <a class="btn btn-primary" href="book/allBook.do">显示全部书籍</a>
            </div>
        <div class="row col-md-8 column">
            <form action="book/queryBook.do" method="post" class="form-inline" style="float: right">
                <div class="form-group">
                    <span style="color: red;font-weight: bold">${error}</span>
                    <input type="text" name="bookName" class="form-control" placeholder="请输入书籍名称">
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
            </form>
        </div>


    </div>
    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                    <tr>
                        <th>书籍编号</th>
                        <th>书籍名称</th>
                        <th>书籍数量</th>
                        <th>书籍详情</th>
                        <th>操作</th>
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <c:forEach var="book" items="${books}">
                        <tr>
                            <td>${book.bookID}</td>
                            <td>${book.bookName}</td>
                            <td>${book.bookCounts}</td>
                            <td>${book.detail}</td>
                            <td>
                                <a href="book/toUpdatePaper.do?id=${book.bookID}">修改</a>
                                &nbsp;|&nbsp;
                                <a href="book/deleteBook.do?id=${book.bookID}">删除</a>
                            </td>
                        </tr>
                    </c:forEach>
                </tbody>
            </table>
        </div>

    </div>
</div>
</body>
</html>
